package com.lagou.analysis.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.lagou.analysis.service.PositionService;
import com.lagou.analysis.service.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping(value = "/position")
public class PositionController {

    @Autowired
    private PositionService positionService;

    /**
     * 分页查询
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @GetMapping(value = "/all")
    public Page<PositionVO> getAllPositionByPage(Integer pageNumber, Integer pageSize){
        return positionService.getPositionList(pageNumber,pageSize);
    }

    /**
     * 分析区域比例
     * @return
     */
    @GetMapping("/district")
    public List<DistrictVO> getDistrictRatio(){
        return positionService.getDistrictRation();
    }

    /**
     * 分析年限比例
     * @return
     */
    @GetMapping("/workYear")
    public List<WorkYearVO> getWorkYear(){
        return positionService.getWorkYearRatio();
    }

    /**
     * 分析公司融资情况比例
     * @return
     */
    @GetMapping("/financeStage")
    public List<FinanceStageVO> getFinanceStage(){
        return positionService.getFinanceStage();
    }

    /**
     * 分析公司融资情况比例
     * @return
     */
    @GetMapping("/salary")
    public List<SalaryVO> getSalary(){
        return positionService.getSalary();
    }

}
